<template>
  <div id="home">
    <ul>
      <li v-for="(item, index) in arr" :key="index" @click="content = item">
        {{ item }}
      </li>
    </ul>
    <div id="news" :is="content"></div>
  </div>
</template>

<script>
import news from "./home/news.vue";
import news2 from "./home/news2.vue";

export default {
  data() {
    return {
      arr: ["news", "news2"],
      content: "news",
    };
  },
  components: {
    news,
    news2,
  },
};
</script>

<style>
ul {
  list-style: none;
  width: 60px;
  margin-left: -20px;
  margin-right: 30px;
}
li {
  line-height: 40px;
  border-bottom: 1px solid black;
}
#home {
  display: flex;
  justify-content: space-between;
}
#news {
  padding-top: 20px;
  width: 300px;
}
</style>
